-----------------------------------------------------------------------------------------
-----------------------------------PopUp Rank -------------------------------------------
-----------------------------------------------------------------------------------------
module(..., package.seeall)

function new(par,onEvent)
	local ui = require("ui")
	local wEasing = require "wEasing"
	local pupGroup = display.newGroup()
	local gui = require "Home.popupRankGui".new()
	local facebookGroup = display.newGroup()
	local arrayStar = {}
	local bg = display.newImageRect(facebookGroup,gui.bg.fn, gui.bg.w, gui.bg.h)
		bg.x = gui.bg.x
		bg.y = gui.bg.y
	a = 0
	for i = 1,5 do
		arrayStar[i] = display.newImageRect(facebookGroup,gui.star.fn, gui.star.w, gui.star.h)
		arrayStar[i].x = gui.star.x+a
		arrayStar[i].y = gui.star.y
		a = a+35
	end
	local txtScore = display.newText(facebookGroup, "20000000", gui.txtScore.x, gui.txtScore.y, native.systemFont,gui.txtScore.size)
		txtScore:setTextColor(unpack(gui.txtScore.color))
	local btnBack = ui.newButton({
									defaultSrc = gui.btnBack.fn,
									overSrc = gui.btnBack.fn,
									defaultX = gui.btnBack.w,
									defaultY = gui.btnBack.h,
									overX = gui.btnBack.w,
									overY = gui.btnBack.h,
									overAlpha = gui.btnBack.overAlpha,
									overScale = gui.btnBack.overScale,
									x = gui.btnBack.x,
									y = gui.btnBack.y,
									onRelease = function()
													transition.to(facebookGroup,{time = 100,alpha = 1, x = 0, y = -500, transition = wEasing.easeOutElastic})
											end
									})
		facebookGroup:insert(btnBack)
	local btnNext = ui.newButton({
									defaultSrc = gui.btnNext.fn,
									overSrc = gui.btnNext.fn,
									defaultX = gui.btnNext.w,
									defaultY = gui.btnNext.h,
									overX = gui.btnNext.w,
									overY = gui.btnNext.h,
									overAlpha = gui.btnNext.overAlpha,
									overScale = gui.btnNext.overScale,
									x = gui.btnNext.x,
									y = gui.btnNext.y
									})
		facebookGroup:insert(btnNext)
	return facebookGroup
	
end